<template>
  <div>
    <div style="margin: 10px 0 20px 0; font-size: 30px; font-weight: bold">《{{doc.title}}》</div>
    <div style="margin: 10px 0; font-size: 13px; color: #666666">作者: {{doc.authorName}} <span>| 更新于：{{doc.updateTime}}</span></div>
<!--    <div style="box-shadow: 0 0 10px rgba(0,0,0,.12); padding: 10px">-->
<!--      <div v-html="doc.content" ></div>-->
<!--    </div>-->
    <el-card class="w-e-text">
      <!-- 预览内容主体 -->
      <div v-html="doc.content"></div>
    </el-card>
  </div>
</template>

<script>
//若直接访问页面，表格样式可能会失效，导包可解决
import E from 'wangeditor'
import hljs from 'highlight.js'

export default {
  name: 'docDetail',
  data() {
    return {
      doc: {}
    }
  },
  //创建时
  created(){
    //vue父子页面传参获取方式
    let id = this.$route.query.id
    if (!id) return
    this.$request.get('/doc/findById/'+id).then(res => {
      this.doc = res.data
    })
  }
}
</script>